package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.domain.db.ReportUser;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ReportUserMapper extends BaseMapper<ReportUser> {

    // 查询相似用户
    @Select("SELECT DISTINCT(user_id),id,user_id,report_id,quest_type,total FROM tb_report_user WHERE report_id = #{reportId} AND user_id != #{userId} AND quest_type = #{id}")
    List<ReportUser> findSimilar(Integer reportId,Long userId,Integer id);
}
